// import request from 'umi-request';

// const base_url = 'http://localhost:9000/api';

import { extend } from 'umi-request';

const request = extend({
  prefix: 'http://localhost:9000/api',
  timeout: 1000,
  headers: {
    // 'Content-Type': 'multipart/form-data',
    'Content-Type': 'application/json',
  },
});

const http = {
  get(url: string, params?: object) {
    return request.get(url, { params }).then((response) => {
      return response;
    });
  },
};

export default http;
